// (c) Copyright Fernando Cerqueira.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.

using System.ComponentModel;
using Microsoft.Windows.Design;
using Microsoft.Windows.Design.Features;
using Microsoft.Windows.Design.Metadata;

namespace DevPhone.Controls.Design
{
    internal class DropDownControlMetadata : AttributeTableBuilder
    {
        public DropDownControlMetadata()
        {
            // Type attributes
            AddCustomAttributes(typeof(DropDownControl), new DescriptionAttribute("Represents a container that can collapsed and expanded with selected item."));
            AddCustomAttributes(typeof(DropDownControl), new FeatureAttribute(typeof(DropDownControlInitializer)));
            AddCustomAttributes(typeof(DropDownControl), new ToolboxBrowsableAttribute(true));

            // Hide properties
            AddCustomAttributes(typeof(DropDownControl), "Height", new BrowsableAttribute(false));
            AddCustomAttributes(typeof(DropDownControl), "Background", new BrowsableAttribute(false));
            AddCustomAttributes(typeof(DropDownControl), "Foreground", new BrowsableAttribute(false));

            // Property attributes

            AddCustomAttributes(typeof(DropDownControl), "Header", new TypeConverterAttribute(typeof(StringConverter)));
            AddCustomAttributes(typeof(DropDownControl), "Header", new CategoryAttribute(MetadataStore.DropDownProperties));
            AddCustomAttributes(typeof(DropDownControl), "Header", new DescriptionAttribute("Gets or sets the header."));

            AddCustomAttributes(typeof(DropDownControl), "HeaderTemplate", new CategoryAttribute(MetadataStore.DropDownProperties));
            AddCustomAttributes(typeof(DropDownControl), "HeaderTemplate", new DescriptionAttribute("Gets or sets the template used to display the control's header."));

            AddCustomAttributes(typeof(DropDownControl), "ContainerAlignment", new CategoryAttribute(MetadataStore.DropDownProperties));
            AddCustomAttributes(typeof(DropDownControl), "ContainerAlignment", new DescriptionAttribute("Gets or sets the container items alignment."));

            AddCustomAttributes(typeof(DropDownControl), "SelectedTemplate", new CategoryAttribute(MetadataStore.DropDownProperties));
            AddCustomAttributes(typeof(DropDownControl), "SelectedTemplate", new DescriptionAttribute("Gets or sets the seleted item template."));

            AddCustomAttributes(typeof(DropDownControl), "ItemCountThreshold", new CategoryAttribute(MetadataStore.DropDownProperties));
            AddCustomAttributes(typeof(DropDownControl), "ItemCountThreshold", new DescriptionAttribute("Gets or sets the item count threshold."));

            AddCustomAttributes(typeof(DropDownControl), "SelectedItem", new CategoryAttribute(MetadataStore.DropDownProperties));
            AddCustomAttributes(typeof(DropDownControl), "SelectedItem", new DescriptionAttribute("Gets or sets the seleted item."));
            AddCustomAttributes(typeof(DropDownControl), "SelectedItem", new TypeConverterAttribute(typeof(StringConverter)));

            AddCustomAttributes(typeof(DropDownControl), "SelectedIndex", new CategoryAttribute(MetadataStore.DropDownProperties));
            AddCustomAttributes(typeof(DropDownControl), "SelectedIndex", new DescriptionAttribute("Gets or sets the index of seleted item."));

            AddCustomAttributes(typeof(DropDownControl), "EllipseBrush", new CategoryAttribute(MetadataStore.BrushesProperties));
            AddCustomAttributes(typeof(DropDownControl), "EllipseBrush", new DescriptionAttribute("Gets or sets the brush from Ellipse."));

            AddCustomAttributes(typeof(DropDownControl), "DisabledBrush", new CategoryAttribute(MetadataStore.BrushesProperties));
            AddCustomAttributes(typeof(DropDownControl), "DisabledBrush", new DescriptionAttribute("Gets or sets the foreground brush from disabled state."));

            AddCustomAttributes(typeof(DropDownControl), "EllipseArrow", new CategoryAttribute(MetadataStore.BrushesProperties));
            AddCustomAttributes(typeof(DropDownControl), "EllipseArrow", new DescriptionAttribute("Gets or sets the brush from internal arrow of Ellipse."));

            AddCustomAttributes(typeof(DropDownControl), "ControlBackground", new CategoryAttribute(MetadataStore.BrushesProperties));
            AddCustomAttributes(typeof(DropDownControl), "ControlBackground", new DescriptionAttribute("Gets or sets the control background color."));

            AddCustomAttributes(typeof(DropDownControl), "ControlForeground", new CategoryAttribute(MetadataStore.BrushesProperties));
            AddCustomAttributes(typeof(DropDownControl), "ControlForeground", new DescriptionAttribute("Gets or sets the control foreground color."));

            // DropDownItem
            AddCustomAttributes(typeof(DropDownItem), new DescriptionAttribute("Class that implements a container for the Dropdown control."));
            AddCustomAttributes(typeof(DropDownItem), new ToolboxBrowsableAttribute(false));


        }

    }
}